package com.ruoyi.yljf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.yljf.domain.CourseNotice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface CourseNoticeMapper extends CommonNoticeMapper<CourseNotice>  {

        @Update("update yljf_course_notice set likes = likes + 1 where id = #{noticeId}")
        @Override
        Integer like(Long noticeId);

        @Update("update yljf_course_notice set likes = likes - 1 where id = #{noticeId} and likes > 0")
        @Override
        Integer undoLike(Long noticeId);

        @Select("select cur_id, notice_content,content_pos from yljf_course_notice where id = #{noticeId}")
        CourseNotice selectContentById(Long noticeId);
}
